public class Course{
	private String majorID="";
 	private String courseID="";
	private String courseName="";
	private String caryCourseSummary = "";
	private int    nEnrolLimit=0;
	private int    nCurrentEnrol=0;
	private String lectureAt="";
	private String dateBegin="";
	private String dateEnd="";
	private String curTeacher="";

	public Course(String majorID, String courseID, String courseName, String caryCourseSummary, int nEnrolLimit,
					int nCurrentEnrol, String lectureAt, String dateBegin, String dateEnd, String strTchr ){

		this.majorID = majorID;
		this.courseID = courseID;
		this.courseName = courseName;
  		this.caryCourseSummary=caryCourseSummary;
		this.nEnrolLimit = nEnrolLimit;
		this.nCurrentEnrol=nCurrentEnrol;
		this.lectureAt=lectureAt;
		this.dateBegin=dateBegin;
		this.dateEnd=dateEnd;
		this.curTeacher = strTchr;
	}

	public void setMajorID(String majorID) {
		this.majorID = majorID;
	}

	public String getMajorID() {
		return majorID;
	}

	public void setCourseID(String courseID) {
		this.courseID = courseID;
	}

	public String getCourseID() {
		return courseID;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCaryCourseSummary(String caryCourseSummary) {
		this.caryCourseSummary=caryCourseSummary;
	}

	public String getCaryCourseSummary() {
		return caryCourseSummary;
	}

	public void setEnrollmentLimit(int nEnrolLimit) {
		this.nEnrolLimit = nEnrolLimit;
	}

	public int getEnrollmentLimit() {
		return nEnrolLimit;
	}

	public void setNCurrentEnrol(int nCurrentEnrol) {
		this.nCurrentEnrol = nCurrentEnrol;
	}

	public int getNCurrentEnrol() {
		return nCurrentEnrol;
	}

	public void setCurrentTeacher(String curTeacher) {
		this.curTeacher = curTeacher;
	}

	public String getCurrentTeacher() {
		return curTeacher;
	}

	public void setLectureHall(String lectureAt) {
		this.lectureAt = lectureAt;
	}

	public String getLectureHall() {
		return lectureAt;
	}

	public void setBeginDate(String dateBegin) {
		this.dateBegin = dateBegin;
	}

	public String getBeginDate() {
		return dateBegin;
	}

	public void setEndDate(String dateEnd) {
		this.dateEnd = dateEnd;
	}

	public String getEndDate() {
		return dateEnd;
	}

	public boolean AddStudent() {
		if (this.isCourseAvailable()) {
			nCurrentEnrol++;
			return true;
		}
		return false;
	}
	public boolean DropStudent() {
		if (nCurrentEnrol > 0) {
			nCurrentEnrol--;
			return true;
		}

		return false;
	}

	public boolean isCourseAvailable() {
		return nCurrentEnrol < nEnrolLimit ;
	}

	//public String toString(){
	//	return majorID+" --"+courseName+"   "+courseID+"   "+dateBegin+"   "+caryCourseSummary+"  "+nEnrolLimit+"  "
	//	       +nCurrentEnrol+"  "+curTeacher+"  "+lectureAt+"  "+dateEnd;
	//}

	public String toString() {
		return (this.majorID + "," +
				this.courseID + ", " +
				this.courseName + ", " +
				this.caryCourseSummary + ", " +
				this.nEnrolLimit + ", " +
				this.nCurrentEnrol + ", " +
				this.lectureAt + ", " +
				this.dateBegin + ", " +
				this.dateEnd + ", " +
				this.curTeacher);
	}
}
